package com.uzai.console.web.zombiepan;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.zombiefan.zombiefan.ZombieFanIdDto;
import com.uzai.console.dto.zombiefan.zombiefan.ZombieFanIdListDto;
import com.uzai.console.dto.zombiefan.zombiefan.ZombieFanQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.sysmaterial.SysMaterialService;
import com.uzai.console.service.zombiefan.ZombieFanService;
import com.uzai.console.vo.zombiefan.zombiefan.ZombieFanVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 清理僵尸粉任务
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "僵尸粉",tags = "僵尸粉|僵尸粉")
@ApiSort(31)
@RestController
public class ZombieFanController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(ZombieFanController.class);

    @Autowired
    private ZombieFanService zombiefanService;
    @Autowired
    private SysMaterialService sysMaterialService;

    @ApiOperation(value = "分页查询僵尸粉列表", notes = "分页查询僵尸粉列表", response = ZombieFanVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/zombiefan/findByPage")
    public Object findZombieFanPage(@RequestBody ZombieFanQuery zombieFanQuery){
        return zombiefanService.findZombieFanList(zombieFanQuery);
    }

    @ApiOperation(value = "查询僵尸粉任务详情", notes = "查询僵尸粉任务详情", response = ZombieFanVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/zombiefan/findById")
    public Object findZombieFan(@RequestBody ZombieFanIdDto zombieFanIdDto){
        return zombiefanService.findZombieFan(zombieFanIdDto);
    }

    @SystemLogType(model = SystemModelEnum.ZombieFan, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "批量删除清理僵尸粉", notes = "批量删除清理僵尸粉")
    @ApiOperationSupport(order = 3)
    @PostMapping("/zombiefan/batchDelete")
    public Object batchDeleteZombieFan(@RequestBody ZombieFanIdListDto zombieFanIdListDto){
        zombiefanService.batchDeleteZombieFan(zombieFanIdListDto);
        return true;
    }

}
